FROM php:7.0.4-fpm

LABEL maintainer="ReallyWang <w578285038@163.com>"

ENV NGINX_VERSION 1.16.1

# 更新apt源 及安装apt-add-repository命令
RUN apt-get update && apt-get install -y sudo libxslt-dev libpcre3 libpcre3-dev openssl libssl-dev zlib1g-dev sed vim \
    lsof libpng-dev libmcrypt-dev libicu-dev

RUN docker-php-ext-install mbstring iconv pdo_mysql mysqli exif intl xsl json soap dom zip opcache sockets \
    && docker-php-ext-install -j$(nproc) iconv mcrypt \
    && docker-php-ext-install -j$(nproc) gd

RUN cd / && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
&& tar -zx -f nginx.tar.gz && cd nginx-$NGINX_VERSION \
&& ./configure --prefix=/usr/local/nginx && make && make install
#&& echo 'include /usr/local/nginx/conf/sites-enabled/*;' >>  /usr/local/nginx/conf/nginx.conf

RUN rm /usr/local/nginx/conf/nginx.conf
COPY ./nginx.conf /usr/local/nginx/conf/nginx.conf
COPY ./www.conf /usr/local/nginx/conf/sites-enabled/www.conf
#RUN sed -i "116i     include \/usr\/local\/nginx\/conf\/sites-enabled\/*\;" /usr/local/nginx/conf/nginx.conf
#RUN cd /usr/local/nginx/sbin && ./nginx
#CMD /usr/local/nginx/sbin/nginx

#COPY ./supervisord.conf /etc/supervisord.conf
#RUN chmod 777 /etc/nginx/sites-enabled/www.conf
